package com.miaosha.ms_04.dao;

import com.miaosha.ms_04.domain.MiaoshaGoods;
import com.miaosha.ms_04.vo.GoodsVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @Description //TODO
 * @Author Administrator
 * @DATE 2020/9/23 20:26
 **/
@Mapper
public interface MiaoshaGoodsDao {

    /**
     * @param goodsId    秒杀商品ID
     * @return java.lang.Integer
     * @Description 修改秒杀活动库存
     **/
    @Update("UPDATE miaosha_goods g SET g.stock_count = stock_count -1 WHERE goods_id = #{goodsId}")
    Integer updateStock(@Param("goodsId") Long goodsId);
}
